package com.ruoyi.web.controller.kerServer;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.kepServer.centralpumphouse.domain.Centralpumphouse;
import com.ruoyi.kepServer.centralpumphouse.service.ICentralpumphouseService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * kepserver中央水泵房Controller
 *
 * @author ruoyi
 * @date 2024-11-05
 */
@RestController
@RequestMapping("/centralpumphouse/centralpumphouse")
public class CentralpumphouseController extends BaseController
{
    @Autowired
    private ICentralpumphouseService centralpumphouseService;

    /**
     * 查询kepserver中央水泵房列表
     */
    @PreAuthorize("@ss.hasPermi('centralpumphouse:centralpumphouse:list')")
    @GetMapping("/list")
    public TableDataInfo list(Centralpumphouse centralpumphouse)
    {
        startPage();
        List<Centralpumphouse> list = centralpumphouseService.selectCentralpumphouseList(centralpumphouse);
        return getDataTable(list);
    }

    /**
     * lqx
     * 查询kepserver中央水泵房列表全部1水泵
     */
    @PreAuthorize("@ss.hasPermi('centralpumphouse:centralpumphouse:list')")
    @GetMapping("/listCentralpumphouse1")
    public List<Centralpumphouse> listCentralpumphouse1(Centralpumphouse centralpumphouse)
    {
        List<Centralpumphouse> list = centralpumphouseService.selectCentralpumphouseList(centralpumphouse);
        return list;
    }

    /**
     * lqx
     * 查询kepserver中央水泵房列表全部2水泵
     */
    @PreAuthorize("@ss.hasPermi('centralpumphouse:centralpumphouse:list')")
    @GetMapping("/listCentralpumphouse2")
    public List<Centralpumphouse> listCentralpumphouse2(Centralpumphouse centralpumphouse)
    {
        List<Centralpumphouse> list = centralpumphouseService.selectCentralpumphouseList(centralpumphouse);
        return list;
    }

    /**
     * lqx
     * 查询kepserver中央水泵房列表全部3水泵
     */
    @PreAuthorize("@ss.hasPermi('centralpumphouse:centralpumphouse:list')")
    @GetMapping("/listCentralpumphouse3")
    public List<Centralpumphouse> listCentralpumphouse3(Centralpumphouse centralpumphouse)
    {
        List<Centralpumphouse> list = centralpumphouseService.selectCentralpumphouseList(centralpumphouse);
        return list;
    }

    /**
     * lqx
     * 查询kepserver中央水泵房列表全部3水泵
     */
    @PreAuthorize("@ss.hasPermi('centralpumphouse:centralpumphouse:list')")
    @GetMapping("/listCentralpumphouse4")
    public List<Centralpumphouse> listCentralpumphouse4(Centralpumphouse centralpumphouse)
    {
        List<Centralpumphouse> list = centralpumphouseService.selectCentralpumphouseList(centralpumphouse);
        return list;
    }


    /**
     * lqx
     * 查询kepserver中央水泵房列表全部(水位1)
     */
    @PreAuthorize("@ss.hasPermi('centralpumphouse:centralpumphouse:list')")
    @GetMapping("/listCentralpumphouse5")
    public List<Centralpumphouse> listCentralpumphouse5(Centralpumphouse centralpumphouse)
    {
        List<Centralpumphouse> list = centralpumphouseService.selectCentralpumphouseList(centralpumphouse);
        return list;
    }

    /**
     * lqx
     * 查询kepserver中央水泵房列表全部(水位2)
     */
    @PreAuthorize("@ss.hasPermi('centralpumphouse:centralpumphouse:list')")
    @GetMapping("/listCentralpumphouse6")
    public List<Centralpumphouse> listCentralpumphouse6(Centralpumphouse centralpumphouse)
    {
        List<Centralpumphouse> list = centralpumphouseService.selectCentralpumphouseList(centralpumphouse);
        return list;
    }

    /**
     * lqx
     * 查询kepserver中央水泵房列表全部(右排水管)
     */
    @PreAuthorize("@ss.hasPermi('centralpumphouse:centralpumphouse:list')")
    @GetMapping("/listCentralpumphouse7")
    public List<Centralpumphouse> listCentralpumphouse7(Centralpumphouse centralpumphouse)
    {
        List<Centralpumphouse> list = centralpumphouseService.selectCentralpumphouseList(centralpumphouse);
        return list;
    }

    /**
     * lqx
     * 查询kepserver中央水泵房列表全部(左排水管)
     */
    @PreAuthorize("@ss.hasPermi('centralpumphouse:centralpumphouse:list')")
    @GetMapping("/listCentralpumphouse8")
    public List<Centralpumphouse> listCentralpumphouse8(Centralpumphouse centralpumphouse)
    {
        List<Centralpumphouse> list = centralpumphouseService.selectCentralpumphouseList(centralpumphouse);
        return list;
    }

    /**
     * lqx
     * 查询kepserver中央水泵房列表全部(工序能耗设定)
     */
    @PreAuthorize("@ss.hasPermi('centralpumphouse:centralpumphouse:list')")
    @GetMapping("/listCentralpumphouse9")
    public List<Centralpumphouse> listCentralpumphouse9(Centralpumphouse centralpumphouse)
    {
        List<Centralpumphouse> list = centralpumphouseService.selectCentralpumphouseList(centralpumphouse);
        return list;
    }

    /**
     * 导出kepserver中央水泵房列表
     */
    @PreAuthorize("@ss.hasPermi('centralpumphouse:centralpumphouse:export')")
    @Log(title = "kepserver中央水泵房", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, Centralpumphouse centralpumphouse)
    {
        List<Centralpumphouse> list = centralpumphouseService.selectCentralpumphouseList(centralpumphouse);
        ExcelUtil<Centralpumphouse> util = new ExcelUtil<Centralpumphouse>(Centralpumphouse.class);
        util.exportExcel(response, list, "kepserver中央水泵房数据");
    }

    /**
     * 获取kepserver中央水泵房详细信息
     */
    @PreAuthorize("@ss.hasPermi('centralpumphouse:centralpumphouse:query')")
    @GetMapping(value = "/{tagName}")
    public AjaxResult getInfo(@PathVariable("tagName") String tagName)
    {
        return success(centralpumphouseService.selectCentralpumphouseByTagName(tagName));
    }

    /**
     * 新增kepserver中央水泵房
     */
    @PreAuthorize("@ss.hasPermi('centralpumphouse:centralpumphouse:add')")
    @Log(title = "kepserver中央水泵房", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody Centralpumphouse centralpumphouse)
    {
        return toAjax(centralpumphouseService.insertCentralpumphouse(centralpumphouse));
    }

    /**
     * 修改kepserver中央水泵房
     */
    @PreAuthorize("@ss.hasPermi('centralpumphouse:centralpumphouse:edit')")
    @Log(title = "kepserver中央水泵房", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody Centralpumphouse centralpumphouse)
    {
        return toAjax(centralpumphouseService.updateCentralpumphouse(centralpumphouse));
    }

    /**
     * 删除kepserver中央水泵房
     */
    @PreAuthorize("@ss.hasPermi('centralpumphouse:centralpumphouse:remove')")
    @Log(title = "kepserver中央水泵房", businessType = BusinessType.DELETE)
	@DeleteMapping("/{tagNames}")
    public AjaxResult remove(@PathVariable String[] tagNames)
    {
        return toAjax(centralpumphouseService.deleteCentralpumphouseByTagNames(tagNames));
    }

    /**
     * 左右水管瞬时流量、累计流量  及  昨日
     */
    @GetMapping("/getWaterList")
    public TableDataInfo getWaterList()
    {
        startPage();
        List<Centralpumphouse> list = centralpumphouseService.getWaterList();
        return getDataTable(list);
    }


    /**
     * 大营大屏  瞬时流量  总流量  水池液位
     */
    @GetMapping("/getDyDpWaterList")
    public TableDataInfo getDyDpWaterList()
    {
        startPage();
        List<Centralpumphouse> list = centralpumphouseService.getDyDpWaterList();
        return getDataTable(list);
    }



    /**
     * 苍海大屏  瞬时流量  总流量  水池液位
     */
    @GetMapping("/getChDpWaterList")
    public TableDataInfo getChDpWaterList()
    {
        startPage();
        List<Centralpumphouse> list = centralpumphouseService.getChDpWaterList();
        return getDataTable(list);
    }
}
